package com.song.api.controller.user;

import com.song.grace.result.GraceJSONResult;
import com.song.pojo.bo.RegisterLoginBO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;

@Api(value = "用户注册登录", tags = {"用户注册登录功能的controller"})
@RequestMapping("passport")
public interface PassportControllerApi {

    @ApiOperation(value = "获取注册登录验证码", notes = "获取注册登录验证码", httpMethod = "GET")
    @GetMapping("getSMSCode")
    public GraceJSONResult getSMSCode(String mobile, HttpServletRequest request);

    @ApiOperation(value = "一键注册登录接口", notes = "一键注册登录接口", httpMethod = "POST")
    @PostMapping("doLogin")
    public GraceJSONResult doLogin(@RequestBody @Valid RegisterLoginBO registerLoginBo,
                                   HttpServletRequest request,
                                   HttpServletResponse response);

    @PostMapping("logout")
    @ApiOperation(value = "用户退出登录", notes = "用户退出登录", httpMethod = "POST")
    public GraceJSONResult logout(HttpServletRequest request,
                                  HttpServletResponse response,
                                  @RequestParam String userId);
}
